package com.projetinfoent.asyncmeteo;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import com.projetinfoent.asyncmeteo.SituationMeteo.ReponseMeteo.Meteo;


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
	    "Location",
	    "Time",
	    "Wind",
	    "Visibility",
	    "SkyConditions",
	    "Temperature",
	    "DewPoint",
	    "RelativeHumidity",
	    "Pressure",
	    "Status"
	})
@XmlRootElement(name = "CurrentWeather")
public class CurrentWeather
{
	
	public String Location;
	public String Time;
	public String Wind;
	public String Visibility;
	public String SkyConditions;
	public String Temperature;
	public String DewPoint;
	public String RelativeHumidity;
	public String Pressure;
	public String Status;
	
	@Override
	public String toString()
	{
		return "CurrentWeather [location=" + Location + ", time=" + Time
				+ ", wind=" + Wind + ", visibility=" + Visibility
				+ ", skyconditions=" + SkyConditions + ", temperature="
				+ Temperature + ", dewpoint=" + DewPoint
				+ ", relativeHumidity=" + RelativeHumidity + ", pressure="
				+ Pressure + ", status=" + Status + ", getClass()="
				+ getClass() + ", hashCode()=" + hashCode() + ", toString()="
				+ super.toString() + "]";
	}
	
	public Meteo toMeteo() {
		Meteo result = new Meteo();
		
		result.setCiel(SkyConditions);
		result.setDateHeure(Time);
		result.setHumidite(RelativeHumidity);
		result.setLieu(Location);
		result.setPointRosee(DewPoint);
		result.setPression(Pressure);
		result.setStatus(Status);
		result.setTemperature(Temperature);
		result.setVent(Wind);
		result.setVisibilite(Visibility);
		
		return result;
	}

}
